<template>
  <div>
    <div class="cs-float-btn" @click="visible = true">
      <el-icon><CustomerService /></el-icon>
      <span>在线客服</span>
    </div>
    <el-dialog v-model="visible" title="在线客服" width="350px" :close-on-click-modal="true">
      <div class="cs-content">
        <div class="cs-item">
          <span>微信客服：</span>
          <img src="/wechat-qrcode.png" alt="微信二维码" class="cs-qrcode" />
        </div>
        <div class="cs-item">
          <span>QQ客服：</span>
          <a href="tencent://message/?uin=12345678" target="_blank">12345678</a>
        </div>
        <div class="cs-item">
          <span>客服电话：</span>
          <a href="tel:400-123-4567">400-123-4567</a>
        </div>
      </div>
    </el-dialog>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { CustomerService } from '@element-plus/icons-vue'
const visible = ref(false)
</script>

<style scoped>
.cs-float-btn {
  position: fixed;
  right: 32px;
  bottom: 80px;
  z-index: 9999;
  background: #409eff;
  color: #fff;
  border-radius: 24px;
  padding: 10px 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 16px;
  transition: background 0.2s;
}
.cs-float-btn:hover {
  background: #337ecc;
}
.cs-float-btn .el-icon {
  margin-right: 8px;
  font-size: 20px;
}
.cs-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: flex-start;
}
.cs-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cs-qrcode {
  width: 80px;
  height: 80px;
  border: 1px solid #eee;
  border-radius: 4px;
  margin-left: 8px;
}
</style> 